home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6349 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.5 KB  |  51 lines

  1. Path: pcc002.ids-scheer.de!news
  2. From: Stefan Wesner <wesner@ids-scheer.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Compiling old "C" code with Borland C++ 3.1  HELP
  5. Date: Fri, 09 Feb 1996 09:05:42 +0000
  6. Organization: IDS Prof. Scheer GmbH
  7. Message-ID: <311B0E66.378D@ids-scheer.de>
  8. References: <4e8es1$ge0@nntp.Stanford.EDU>
  9. NNTP-Posting-Host: pcg140.ids-scheer.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (WinNT; I)
  14.  
  15. Scott Wang wrote:
  16. >         I'm trying to compile a C program on Borland C++ 3.1 but I'm
  17. > having a little trouble.  I have custom interfaces that I want to
  18. > #include but when I try to run it it gets a linking error:
  19. > Compiling TIMESORT.C:
  20. > Compiling SORT.C:
  21. > Linking SORT.EXE:
  22. > Linker Warning: No module definition file specified: using defaults
  23. > Linker Error: Undefined symbol _RandomInteger in module TIMESORT.C
  24. > Linker Error: Undefined symbol _GetBlock in module TIMESORT.C
  25. > Linker Error: Undefined symbol _GetInteger in module TIMESORT.C
  26. > Enclose your c-funktion in a extern "c" block
  27.  
  28. extern "c" {
  29. // the c-code
  30.  
  31. }
  32.  
  33. You prevent your c-function names from a underscore at the beginning.
  34.  
  35. Hope it will work. 
  36.  
  37. Stefan.
  38.  
  39.  
  40.  
  41.    __&__    Stefan Wesner             e-mail: stwe0000@stud.uni-sb.de
  42.   /     \   Schulstr. 86                      wesner@ids-scheer.de 
  43.  |       |  66125 Saarbruecken     http://www.ee.uni-sb.de/iaeste/STAFF/stefan.html
  44.  |  (o)(o)                                     
  45.  C   .---_)
  46.   | |.___|  
  47.   |  \__/  
  48.   /_____\
  49.